#include "UtilityPCH.h"
#include "UT_FilterTriangle.h"
#include "UT_MathHelper.h"

using namespace Utility;
//-----------------------------------------------------------------------
UT_FilterTriangle::UT_FilterTriangle(float fXWidth, float fYWidth)
	: UT_FilterBase(fXWidth,fYWidth)
{

}
//-----------------------------------------------------------------------
float UT_FilterTriangle::Evaluate(float x, float y) const
{
	return UT_MathHelper::Max(0.f,m_fXWidth - UT_MathHelper::Abs(x)) *
			UT_MathHelper::Max(0.f,m_fYWidth - UT_MathHelper::Abs(y));
}

